package com.rz.admin.dubbo.service;

import com.rz.admin.entity.SysZone;
import com.rz.admin.service.IZoneService;
import consumer.ZoneService;
import consumer.model.Zone;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.BeanUtils;

import javax.annotation.Resource;

/**
 * @ClassName ZoneServiceImpl
 * @Description 邮政分区
 * @Author maweiyue
 * @Date 2019/09/03 20:37
 */
@Service(version = "1.0.0")
public class ZoneServiceImpl implements ZoneService {

    @Resource
    private IZoneService zoneService;

    @Override
    public Zone getByContryAndZip(String country, String fromZip, String toZip) {
        SysZone sysZone = this.zoneService.getByContryAndZip(country, fromZip, toZip);
        if (sysZone != null) {
            Zone zone = new Zone();
            BeanUtils.copyProperties(sysZone, zone);
            return zone;
        }
        return null;
    }
}
